#ifndef _FPDFEMB_ADDIN_H_
#define _FPDFEMB_ADDIN_H_

#ifdef __cplusplus
extern "C" {
#endif

typedef unsigned long			FPDFEMB_DWORD;
typedef FPDFEMB_DWORD			FPDFEMB_COLORREF;
/**
 * Function: FPDFEMB_StartRenderWithColor
 *			Start rendering of a page and set fore and background color.
 *
 * Comments:\n
 *			Rendering is a progressive process. This function starts the rendering process,
 *			and may return before rendering is finished, if a pause structure is provided.
 *
 *			Application should call FPDFEMB_ContinueRender repeatedly to finish the rendering 
 *			when return value is FPDFERR_TOBECONTINUED.
 *
 *			There can be only one rendering procedure for a page at any time. And rendering
 *			can be started over and over again for the same page. If a page rendering is already
 *			active, starting another one will cancel the previous rendering.
 *
 *			In this function, user can customize the fore color and background color of document. 
 *
 * @param[out] dib			DIB handle, as the rendering device
 * @param[in] page			Page handle. The page has to be parsed first.
 * @param[in] start_x		Left pixel position of the display area in the device coordination
 * @param[in] start_y		Top pixel position of the display area in the device coordination
 * @param[in] size_x		Horizontal size (in pixels) for displaying the page
 * @param[in] size_y		Vertical size (in pixels) for displaying the page
 * @param[in] rotate		Page orientation: 0 (normal), 1 (rotated 90 degrees clockwise),
 *								2 (rotated 180 degrees), 3 (rotated 90 degrees counter-clockwise).
 * @param[in] flags			0 for normal display, or combination of flags defined above
 * @param[in] clip			Pointer to clip rectangle (in DIB device coordinations),
 *							or NULL if no clipping needed.
 * @param[in] pause			Pointer to a structure that can pause the rendering process.
 * 							Can be NULL if no pausing is needed.
 * @param[in] bSetColor		Whether or not set fore color and background color.
 * @param[in] backColor     Background Color, ARGB order;
 * @param[in] foreColor		Foreground Color, ARGB order;
 *
 * @retval FPDFERR_SUCCESS			rendering successfully finished;
 * @retval FPDFERR_TOBECONTINUED	rendering started successfully, but not finished;
 * @retval Other return value		error code.
 */
FPDFEMB_RESULT FPDFEMB_StartRenderWithColor(FPDFEMB_BITMAP dib, FPDFEMB_PAGE page,
						int start_x, int start_y, int size_x, int size_y, int rotate, int flags,
						struct FPDFEMB_RECT* clip, struct FPDFEMB_PAUSE* pause,
						FPDFEMB_BOOL bSetColor, FPDFEMB_COLORREF backColor, FPDFEMB_COLORREF foreColor);


#ifdef __cplusplus
};
#endif

#endif//_FPDFEMB_ADDIN_H_